<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vueJS/vue.js"></script>
</head>

<body>
    <div id="app">
        {{message}}
    </div>

    <div id="app2">
        <span v-bind:title="message">
            鼠标悬停几秒钟看此处动态绑定的提示信息
        </span>
    </div>

    <div id="app3">
        <p v-if="seen">
            现在你看到我了
        </p>
    </div>

    <div id="app4">
        <ol>
            <li v-for="item in todos">
                {{item.text}}
            </li>
        </ol>
    </div>

    <div id="app5">
        <p>
            {{message}}
        </p>
        <button @click="reverseMessage">
            翻转消息
        </button>
    </div>

</body>

</html>
<script type="text/javascript">

    var app5 = new Vue({
        el: '#app5',
        data: {
            message: 'Hello VueJs'
        },
        methods: {
            reverseMessage: function () {
                this.message = this.message.split('').reverse().join('')
            }
        }
    })

    var app4 = new Vue({
        el: '#app4',
        data: {
            todos: [
                { text: '学习JavaScript' },
                { text: '学习Vue' },
                { text: '整个牛项目' }
            ]
        }
    })

    var app3 = new Vue({
        el: '#app3',
        data: {
            seen: true
        }
    })

    var app2 = new Vue({
        el: '#app2',
        data: {
            message: '页面加载于' + new Date().toLocaleDateString()
        }
    })

    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue'
        }
    })
</script>